﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace pwblog.Common
{
    public class MD5Utility
    {
        public static string Encode(string needToEncodedString)
        {
            System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
            byte[] pw_bytes = System.Text.Encoding.UTF8.GetBytes(needToEncodedString);
            pw_bytes = md5.ComputeHash(pw_bytes);

            return BitConverter.ToString(pw_bytes);
        }
    }
}